using System;
using System.Collections.Generic;
using System.ServiceModel;

namespace InfFront.UICore
{
    /// <summary>
    /// The IInfoCommand enabling strategy
    /// </summary>
    public enum CommandEnablingStrategy { AlwaysEnabled, AlwaysDisabled, AlwaysEnabledWhenThereIsEntries, AlwaysEnabledWhenThereIsCurrentEntry, NeedsEnableCheck };

    /// <summary>
    /// The IInfoCommand execution method
    /// </summary>
    public enum CommandCallMethod { Synchronous, Asynchronous, InMainThread };

    /// <summary>
    /// InfoSource command list entry
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IInfoCommand
    {
        /// <summary>
        /// Unique (within the InfoSource) InfoCommand name
        /// </summary>
        [OperationContract]
        string GetName();

        /// <summary>
        /// Command title
        /// </summary>
        [OperationContract]
        string GetTitle();

        /// <summary>
        /// Command comment to show it in the tooltip
        /// For instance, if the *Title* is "Up" then the *Comment* should be "Navigates to the parent folder" or like that
        /// </summary>
        [OperationContract]
        string GetComment();

        /// <summary>
        /// Command order
        /// </summary>
        [OperationContract]
        int GetOrder();

        /// <summary>
        /// Get the main Command icon
        /// </summary>
        /// <param name="args">parameters</param>
        /// <returns>IImage instance</returns>
        [OperationContract]
        IImage GetIcon(IInfoCommandGetIconArgs args);

        /// <summary>
        /// The Command enabling strategy
        /// </summary>
        [OperationContract]
        CommandEnablingStrategy GetEnablingStrategy();

        /// <summary>
        /// The *Command* preferred execution method
        /// </summary>
        [OperationContract]
        CommandCallMethod GetPreferredCallMethod();
    }

    /// <summary>
    /// IInfoCommand.GetIcon function parameters
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IInfoCommandGetIconArgs
    {
        /// <summary>
        /// Icon horizontal size (16, 24, 32, 72, 128 or other)
        /// </summary>
        [OperationContract]
        int GetHSize();

        /// <summary>
        /// Icon vertical size (16, 24, 32, 72, 128 or other)
        /// </summary>
        [OperationContract]
        int GetVSize();

        /// <summary>
        /// Style of the icon
        /// </summary>
        [OperationContract]
        IconStyle GetStyle();
    }

    /// <summary>
    /// InfoCommand enumeration interface
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IInfoCommandList : IContainer<IInfoCommand>
    {
    }
}
